#include <iostream>
#include <string>

using namespace std;

class Solution {
public:
  bool isSubsequence(string s, string t) {
    // codes
    string::iterator si = s.begin();
    string::iterator ti = t.begin();

    while (si!= s.end() && ti != t.end()){
      if (*si == *ti){
	si++;
      }
      ti++;
    }

    if (si == s.end()){
      return true;
      
    }
    return false;
  }
};

void testcase01(){
  printf("\n%s Running\n", __FUNCTION__);
  string s = "abc";
  string t = "ahbgdc";

  bool want = true;
  Solution so;
  bool got = so.isSubsequence(s, t);
  if (got != want){
    printf("failed! want:%u, but got:%u\n", want, got);
  }
}

int main() {
  // tests
  testcase01();
  return 0;
}
